
<ui:composition 
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">

    <h:form prependId="false">

        <p:panel header="Seleccionar" >
            
            <c:forEach items="#{rubroMB.rubrosCliente}" var="r" >

                <c:choose>
                    <c:when test="#{r.nuevo == 'S'}">

                        <p:commandLink title="Click para filtrar por rubro"
                                       styleClass="subRubroStyleNew"
                                       actionListener="#{carritoMB.verProductos(r)}"
                                       onstart="ajaxTree.show()"
                                       oncomplete="ajaxTree.hide()"
                                       update="form" >
                            <h:outputText value="#{r.descripcion}" style="color: #466296; font-style: normal;" />
                        </p:commandLink>
                    </c:when>
                    
                    <c:otherwise>
                        <p:commandLink title="Click para filtrar por rubro"
                                       styleClass="subRubroStyle"
                                       actionListener="#{carritoMB.verProductos(r)}"
                                       onstart="ajaxTree.show()"
                                       oncomplete="ajaxTree.hide()"
                                       update="form" >
                            <h:outputText value="#{r.descripcion}" style="color: #466296; font-style: normal;" />
                        </p:commandLink>
                    </c:otherwise>
                </c:choose>

                <p:spacer height="8px" width="180" />
                

            </c:forEach>

            
        </p:panel>  
        
        <p:dialog header="Aguarde por favor..." widgetVar="ajaxTree" 
                  width="200"
                  resizable="false"
                  modal="true"
                  closable="false">
            <div style="text-align: center">
                <p:graphicImage value="../resources/images/ajax-loader.gif" />                
             </div>
        </p:dialog>

    </h:form>         


</ui:composition>
